package com.mingzhi;

import com.mingzhi.dao.BookDao;
import com.mingzhi.service.BookService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        //获取 IoC 容器
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        //获取 bean
//        BookDao bookDao = (BookDao) context.getBean("bookDao");
//        bookDao.save();
        BookService bookService = (BookService) context.getBean("bookService");
        bookService.save();
    }
}
